package edu.sctu.wangfuxin.day20150524;

import java.util.*;
/**
 * Created by user06 on 2015/5/25.
 */
public class Test {
    public void regist (int num) throws MyException{
        if (num < 0) {
            throw new MyException("人数为负值，不合理",1);
        }
        System.out.println("登记人数 " + num);
    }
    public void manager(){
        Scanner imput = new Scanner(System.in);
        int a = imput.nextInt();
        try {
            regist(a);
        }catch (MyException e) {
            System.out.println("登记失败，出错类型码=" + e.getId());
            e.printStackTrace();
        }
        System.out.println("操作结束");
    }

    public static void main(String[] args) {
        Test t = new Test();
        t.manager();
    }
}
